<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>打印灵性</title>
</head>
<body>
<script>
  var num = prompt("脚本提示：\n请输入打印的行数：");
  for (var i = num; i >= 0; i--) {
    document.write("</br>")
    for (var j = 1; j <= i; j++) {
      document.write("&nbsp" + "&nbsp" + "&nbsp");
    }
    for (var k = num-1; k >= i; k--) {
      document.write("*" + "&nbsp" + "&nbsp" + "&nbsp" + "&nbsp" + "&nbsp");
    }
  }
  for (var i = 0; i <= num; i++) {
    document.write("</br>")
    for (var j = 0; j <= i; j++) {
      document.write("&nbsp" + "&nbsp" + "&nbsp");
    }
    for (var k = num-1; k > i; k--) {
      document.write("*" + "&nbsp" + "&nbsp" + "&nbsp" + "&nbsp" + "&nbsp");
    }
  }
</script>
</body>
</html>
